package com.ruoyi.aitcommon.utils;

import cn.hutool.core.util.StrUtil;

public class VersionUtils {
	private static final String CodeVersion="20240802";
	private static String DBVersion="";
	
	public static String getCodeVersion() {
		return CodeVersion;
	}
	
	public static String getDBVersion() throws Exception {
		if(StrUtil.isNotBlank(DBVersion))
			return DBVersion;
		else {
			Object ret = SQLUtils.execQueryOne("select version from ait_version", "version");
			if(ret==null||StrUtil.isBlankIfStr(ret)) {
				throw new Exception("查询AIT数据版本失败!");
			}
			DBVersion=ret.toString();
			return DBVersion;
		}
	}
}
